package springboot.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 注解@SpringBootApplication指名是一个Spring Boot的应用
 * main方法指明程序的入口或主程序，运行时首先被执行
 *
 * 注解@RestController标注是一个控制器
 */
@SpringBootApplication
@RestController
public class SpringBootHelloApplication {

	@GetMapping("hello")
	public String hello() {
		return "hello spring-boot";
	}

	public static void main(String[] args) {
		SpringApplication.run(SpringBootHelloApplication.class, args);
	}
}
